Skip to content

新增 wx-java-bom 模块,支持统一管理 WxJava 依赖版本#3975

Open
Copilot wants to merge 5 commits intodevelopfrom
copilot/add-bom-dependency-management
Open

新增 wx-java-bom 模块,支持统一管理 WxJava 依赖版本#3975
Copilot wants to merge 5 commits intodevelopfrom
copilot/add-bom-dependency-management

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

同时引用多个 WxJava 模块时,用户需手动对齐各模块版本。新增 BOM 模块解决此问题。

变更内容

  • 新增 wx-java-bom 模块:packaging 为 pomdependencyManagement 中声明全部 WxJava 模块版本(核心模块 9 个、Spring Boot Starters 聚合 POM + 14 个子模块、Solon Plugins 聚合 POM + 11 个子模块),统一使用 ${project.version}
  • pom.xml:在 <modules> 末尾注册 wx-java-bom
  • README.md:在 Maven 引用章节补充 BOM 使用示例,使用版本占位符说明

使用方式

<properties>
  <wx-java.version>请替换为当前发布版本</wx-java.version>
</properties>

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.github.binarywang</groupId>
      <artifactId>wx-java-bom</artifactId>
      <version>${wx-java.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<!-- 之后无需指定版本 -->
<dependency>
  <groupId>com.github.binarywang</groupId>
  <artifactId>weixin-java-mp</artifactId>
</dependency>
<dependency>
  <groupId>com.github.binarywang</groupId>
  <artifactId>weixin-java-pay</artifactId>
</dependency>

Copilot AI and others added 2 commits April 30, 2026 08:03
Copilot AI changed the title [WIP] Add BOM for dependency management 新增 wx-java-bom 模块,支持统一管理 WxJava 依赖版本 Apr 30, 2026
Copilot AI requested a review from binarywang April 30, 2026 08:06
@binarywang binarywang marked this pull request as ready for review April 30, 2026 11:47
Copilot AI review requested due to automatic review settings April 30, 2026 11:47
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 30, 2026

🤖 Augment PR Summary

Summary: This PR introduces a Maven BOM module to make it easier to align versions when users depend on multiple WxJava artifacts.

Changes:

  • Added a new wx-java-bom module (packaging pom) that defines dependencyManagement entries for all WxJava modules using ${project.version}.
  • Registered wx-java-bom in the root pom.xml so it builds/publishes with the multi-module project.
  • Updated README.md to document BOM-based dependency usage (recommended) alongside the existing single-module usage.

Technical Notes:

  • Consumers can import the BOM via <type>pom</type> + <scope>import</scope>, then omit per-module version declarations.
  • The BOM currently enumerates core modules, Spring Boot starters, and Solon plugins to keep versions consistent across the ecosystem.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread wx-java-bom/pom.xml
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wx-java-bom currently inherits from the root wx-java parent; when consumers import this BOM, they may also inherit the parent’s full dependencyManagement (third-party libs like slf4j-api, jackson-bom, etc.), potentially overriding application-chosen versions—was that intended for this BOM’s contract?

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread wx-java-bom/pom.xml
<name>WxJava - BOM</name>
<description>WxJava 依赖管理 BOM(Bill of Materials),用于统一管理 WxJava 各模块的版本</description>

<dependencyManagement>
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This BOM manages individual starter/plugin artifacts, but it doesn’t appear to manage the aggregator POMs (e.g., wx-java-spring-boot-starters, wx-java-solon-plugins), so users depending on those would still need to set versions explicitly.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 新增一个 Maven BOM 模块,用于在用户同时引入多个 WxJava 子模块时,通过 dependencyManagement 统一对齐版本,避免各模块版本不一致带来的依赖冲突。

Changes:

  • 新增 wx-java-bom 模块(packaging=pom),在 dependencyManagement 中集中声明 WxJava 相关 artifact 版本为 ${project.version}
  • pom.xml 注册新模块,纳入多模块构建
  • README 增加 BOM 的推荐用法示例

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
wx-java-bom/pom.xml 新增 BOM,用于集中管理 WxJava 相关模块版本
pom.xml wx-java-bom 纳入根聚合构建模块列表
README.md 增加 BOM 引用方式与示例,指导用户使用

Comment thread README.md Outdated
Comment thread wx-java-bom/pom.xml
Comment on lines +66 to +76
<!-- WxJava Spring Boot Starters -->
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-mp-spring-boot-starter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-mp-multi-spring-boot-starter</artifactId>
<version>${project.version}</version>
</dependency>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30f3c7eabf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md Outdated
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-bom</artifactId>
<version>4.8.0</version>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update BOM example to a version that contains this module

The README snippet pins wx-java-bom to 4.8.0, but this commit is the one that introduces the wx-java-bom artifact, so users copying this example will request a version that does not include the BOM and Maven resolution will fail. This makes the new recommended setup path unusable until the documented version is changed to a release that actually publishes com.github.binarywang:wx-java-bom.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@zhujianxintian zhujianxintian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议在 README.md 文件中举例使用 bom 管理依赖的时候增加说明,(4.8.0 才新增 bom 模块),减少使用者的试错成本,其他的没有问题

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@binarywang
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 1, 2026

@copilot apply changes based on the comments in this thread

已在 commit af9b902 中将 wx-java-spring-boot-starterswx-java-solon-plugins 两个聚合 POM 添加到 BOM 的 dependencyManagement 中(带 <type>pom</type>),覆盖完整发布物。

@zhujianxintian
Copy link
Copy Markdown

ai是不是理解错了,那两个模块好像并没有加入 bom 的必要 @binarywang ,还是说我理解错了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

是否考虑增加 bom 进行依赖管理呢

4 participants